<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
		<title>demo</title>
		<script type="text/javascript" src="/Public/js/jquery-1.8.1.js" ></script>
		<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" ></script>
	</head>
	<body>
		<center>
			<h2>{$openid}</h2>
		<button>PAY</button>
		
		</center>
	</body>
	
	<script language="JavaScript">
$(function(){
	$('button').click(function(){
		var url = "{:U('Wx/getPayParm')}";
		$.getJSON(url,function(obj){
			var conf = eval('('+obj.d+')');
			console.log(conf);
			WeixinJSBridge.invoke(
					'getBrandWCPayRequest',
					conf,
					function(res){
						console.log(JSON.stringify(res)); 
					}
				);
		});
	});
}); 
	</script>
</html>
